package com.joey.cloud.psn.business.service.impl;

import com.joey.cloud.psn.business.entity.SysRole;
import com.joey.cloud.psn.business.mapper.SysRoleMapper;
import com.joey.cloud.psn.business.service.ISysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 权限信息 服务实现类
 * </p>
 *
 * @author Joey
 * @since 2021-03-19
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

    @Override
    public Set<String> buildRoleKeySet(List<SysRole> roleList) {
        Set<String> roleKeySet = new HashSet<>();
        if(roleList!=null&&roleList.size()>0){
            for(SysRole role:roleList){
                roleKeySet.add(role.getRoleKey());
            }
        }
        return roleKeySet;
    }
}
